<html>
<head><meta charset="utf-8"><title>incorrect suggestion for range_plus_one · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html">incorrect suggestion for range_plus_one</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221986252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/incorrect%20suggestion%20for%20range_plus_one/near/221986252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html#221986252">(Jan 07 2021 at 19:06)</a>:</h4>
<p>Hello!</p>
<p>I have a <code>Span</code> trait for my errors crate, and i tend to use <code>self.cur..self.cur + 1</code> a lot in my parser. I do not implement <code>Span</code> for <code>RangeInclusive</code> however, but clippy still suggests i use <code>self.cur..=self.cur</code>. Shouldn't it check if <code>RangeInclusive</code> is actually correct in that position?</p>



<a name="221986330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/incorrect%20suggestion%20for%20range_plus_one/near/221986330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html#221986330">(Jan 07 2021 at 19:07)</a>:</h4>
<p>this should just be a bug report I think</p>



<a name="221986350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/incorrect%20suggestion%20for%20range_plus_one/near/221986350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html#221986350">(Jan 07 2021 at 19:07)</a>:</h4>
<p>any time a suggestion fails to compile it's a bug</p>



<a name="221986374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/incorrect%20suggestion%20for%20range_plus_one/near/221986374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html#221986374">(Jan 07 2021 at 19:07)</a>:</h4>
<p>Ah ok, i was not quite sure, ill open an issue then</p>



<a name="221989751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/incorrect%20suggestion%20for%20range_plus_one/near/221989751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html#221989751">(Jan 07 2021 at 19:35)</a>:</h4>
<p>Opened an issue <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span> <a href="https://github.com/rust-lang/rust-clippy/issues/6561">https://github.com/rust-lang/rust-clippy/issues/6561</a></p>



<a name="221991568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/incorrect%20suggestion%20for%20range_plus_one/near/221991568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html#221991568">(Jan 07 2021 at 19:49)</a>:</h4>
<p>Duplicate of <a href="https://github.com/rust-lang/rust-clippy/issues/3307">clippy#3307</a></p>



<a name="221991672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/incorrect%20suggestion%20for%20range_plus_one/near/221991672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html#221991672">(Jan 07 2021 at 19:50)</a>:</h4>
<p>heh my bad, i tried looking for one but github search is really bad apparently <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="221992485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/incorrect%20suggestion%20for%20range_plus_one/near/221992485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/incorrect.20suggestion.20for.20range_plus_one.html#221992485">(Jan 07 2021 at 19:57)</a>:</h4>
<p>searching for the lint name in the issues brought it up <span aria-label="stuck out tongue wink" class="emoji emoji-1f61c" role="img" title="stuck out tongue wink">:stuck_out_tongue_wink:</span> But no problem. Reporting duplicates is better than not reporting :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>